blob: e786ef78b737332899e8166ec6b79f20d57da74a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
import dynamic from 'next/dynamic'
import { getIdFromSlug, getNameFromSlug } from '@/core/utils/slug'
import { useRouter } from 'next/router'
import _ from 'lodash'
import Seo from '@/core/components/Seo'
import Breadcrumb from '@/lib/brand/components/Breadcrumb'
import useBrand from '@/lib/brand/hooks/useBrand'
import PageNotFound from '@/pages/404';
const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout'))
const ProductSearch = dynamic(() => import('@/lib/product/components/ProductSearch'))
const Brand = dynamic(() => import('@/lib/brand/components/Brand'))
export default function BrandDetail() {
const router = useRouter()
const { slug = '' } = router.query
const brandName = getNameFromSlug(slug)
const id = getIdFromSlug(slug)
const {brand} = useBrand({id})
if (!brand || !brand.data || _.isEmpty(brand.data)) {
return <PageNotFound />;
}
return (
<BasicLayout>
<Seo
title={`Jual Produk Resmi ${brandName} Indonesia | Indoteknik.com`}
description='B2B Marketplace MRO & Industri dengan Layanan Pembayaran Tempo, Faktur Pajak, Online Quotation, Garansi Resmi & Harga Kompetitif'
additionalMetaTags={[
{
property: 'keywords',
content: `Jual ${brandName}, beli ${brandName}, Distributor ${brandName} Indonesia, cari ${brandName}, produk ${brandName}, ${brandName} Indonesia, harga ${brandName}`
}
]}
/>
<Breadcrumb brandName={brandName} />
<Brand brand={brand} />
{!_.isEmpty(router.query) && (
<ProductSearch
query={_.omit(router.query, 'slug')}
prefixUrl={`/shop/brands/${slug}`}
defaultBrand={getNameFromSlug(slug)}
brand={brand}
/>
)}
</BasicLayout>
)
}
|